Closed Bug 979255 Opened 11 years ago Closed 4 years ago

TSan: data race security/nss/lib/freebl/mpi/mpmontg.c:1127 mp_exptmod

Categories

(NSS :: Libraries, defect, P1)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1615569
3.16.1

People

(Reporter: decoder, Assigned: wtc)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tsan])

Attachments

(1 file)

The attached logfile shows a thread/data race (mozilla-central revision 626d99c084cb) detected by TSan (ThreadSanitizer). Typically, races reported by TSan are not false positives, but it is possible that the race is benign. Even in this case though, we should try to come up with a fix unless this would cause inacceptable performance issues. Also note that seemingly benign races can possibly be harmful (also depending on the compiler and the architecture) [1]. If the bug cannot be fixed, then this bug should be used to either make a compile-time annotation for blacklisting or add an entry to the runtime blacklist. [1] http://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong
Assignee: nobody → nobody
Component: Security → Libraries
Product: Core → NSS
Version: Trunk → trunk
This looks like two threads doing an RSA operation, both utilizing the modular exponentiation function, racing on setting the global mp_exptmod.max_window_bits. Not sure if this is harmful in any way, please check. If it's not a problem, maybe we can make operations on mp_exptmod.max_window_bits at least atomic to prevent it from being reported.
Christian: thanks for the bug report and investigation. I agree that code looks like a thread-unsafe one-time initialization. The NSS "freebl" library has an initialization function BL_Init: http://mxr.mozilla.org/nss/ident?i=BL_Init I'll try to move that code to BL_Init.
Assignee: nobody → wtc
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → 3.16.1
Wan-Teh, do you have an opinion on the exploitability of this bug?
Matt: I think this data race doesn't need to be marked as security-sensitive. Assuming this data race can cause a big-integer arithmetic error, NSS has defenses such as doublechecking the results of calculations vulnerable to software or hardware faults.
Group: core-security
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: